<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:cml="http://www.xml-cml.org/schema">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<script>
		var htmlNs = 'http://www.w3.org/1999/xhtml';
		var cmlNs = 'http://www.xml-cml.org/schema';
		function testHtmlElement()
		{
			var elems = document.getElementsByTagNameNS(htmlNs, 'div');
			if (elems.length > 0)
				alert(elems[0].innerHTML);
			else
				alert('Element not found!')
		}
		function testCmlElement()
		{
			var elems = document.getElementsByTagNameNS(cmlNs, 'molecule');
			//var elems = document.getElementsByTagName('cml:molecule');
			if (elems.length > 0)
				alert(elems[0].innerHTML);
			else
				alert('Element not found!')
		}
	</script>
</head>
<body>
	<a href="javascript:testHtmlElement()">Test HTML</a>
	<a href="javascript:testCmlElement()">Test CML</a>
	<div>This is a div.</div>
	<cml:molecule>
		<cml:name>TestMol</cml:name>
	</cml:molecule>
</body>
</html>